package server.controller;

import java.util.Timer;
import java.util.TimerTask;

public class PcExpController extends TimerTask{
	private static Timer _characterExpLawfulUpdateTimer = new Timer();
	private final int _updateTime;
	
	public PcExpController(int updateTime) {
		_updateTime = updateTime;
	}
	public void start() {
		_characterExpLawfulUpdateTimer.scheduleAtFixedRate(PcExpController.this, 0, _updateTime);
	}
	
	@Override
	public void run()
	{
		/*
		try {
			for(L1PcInstance _client : L1World.getInstance().getAllPlayers()){
				if(_client == null || _client.getNetConnection() == null){
					continue;
				}else{
					try {
						
						
						
						if (_client.get_oldlawful() != _client.getLawful()) {
							_client.set_oldlawful(_client.getLawful());
							S_Lawful s_lawful = new S_Lawful(_client.getId(), _client.get_oldlawful());
							_client.sendPackets(s_lawful);
							Broadcaster.broadcastPacket(_client, s_lawful);
						}

						if (_client.get_oldExp() != _client.getExp()) {
							_client.set_oldExp(_client.getExp());
							_client.onChangeExp();
						}
						_client.updateObject();
					}catch (Exception e) {
						_log.warning("Client exp/lawful update failure.");
						_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
						throw e;
					}
				}
			}
		}
		catch (Exception e) {
			_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
			//cancel();
		}
			*/
	}

}
